import store from '/store'; //导入 store 对象
export function handlePushMessage(msg) {
	console.log(1)
	const not = new Notification('新的订单!', {body: '新的易派订单请及时查看',vibrate: true});
	store.commit("PUSH_ORDER_MSG",true)
	setTimeout(() => {
		not.close()
	}, 5000)
	requestNotificationPermission()
}

function requestNotificationPermission() {
	if (!("Notification" in window)) {
		console.log("This browser does not support desktop notifications.");
		return;
	}
	Notification.requestPermission()
}